In
addition to using the predefined hatch patterns that are supplied,
you can design and create your own custom hatch patterns.
In addition to using the predefined hatch
patterns that are supplied, you can design and create your own custom
hatch patterns. Developing a hatch pattern definition requires knowledge,
practice, and patience. Because customizing hatches requires familiarity
with hatch patterns, it is not recommended for new users.
The hatch patterns supplied by AutoCAD are
stored in the acad.pat and acadiso.pat text files. You
can add hatch pattern definitions to this file or create your own
files.
Regardless of where the definition is stored,
a custom hatch pattern has the same format. It has a header line
with a name, which begins with an asterisk and is no more than 31
characters long, and an optional description:
*pattern-name, description
It also has one or more line descriptors of
the following form:
angle, x-origin,y-origin, delta-x,delta-y,dash-1,dash-2, …
The default hatch pattern ANSI31 shown
in the Boundary Hatch and Fill dialog box looks like this:
and is defined as follows:
*ANSI31, ANSI Iron, Brick, Stone masonry
45, 0,0, 0,.125
The pattern name on the first line, *ANSI31, is followed by a description: ANSI Iron, Brick, Stone masonry. This
simple pattern definition specifies a line drawn at an angle of
45 degrees, that the first line of the family of hatch lines is
to pass through the drawing origin (0,0), and that the spacing between hatch
lines of the family is to be 0.125 drawing units.
Hatch pattern definitions follow these rules:
- Each line in a pattern definition can
contain up to 80 characters. You can include letters, numbers, and
the special characters underline (_), hyphen (-), and dollar sign
($). However, you must begin a pattern definition with a letter
or number, not a special character.
- AutoCAD ignores both blank lines and
text to the right of a semicolon.
- Each pattern line is considered to be
the first member of a line family, created by applying the delta
offsets in both directions to generate an infinite family of parallel
lines.
- The delta-x value
indicates the displacement between members of the family in the
direction of the line. It is used only for dashed lines.
- The delta-y value
indicates the spacing between members of the family; that is, it
is measured perpendicular to the lines.
- A line is considered to be of infinite
length. A dash pattern is superimposed on the line.
NoteA blank line must
be placed after the last hatch pattern definition in a PAT file.
If a blank line is not placed after the last hatch pattern definition,
the last hatch pattern definition will not be accessible when creating
a hatch fill.
The process of hatching consists of expanding
each line in the pattern definition to its infinite family of parallel
lines. All selected objects are checked for intersections with any
of these lines; any intersections cause the hatch lines to be turned
on and off as governed by the hatching style. Each family of hatch
lines is generated parallel to an initial line with an absolute
origin to guarantee proper alignment.
If
you create a very dense hatch, AutoCAD may reject the hatch and
display a message indicating that the hatch scale is too small or
its dash length too short. You can change the maximum number of
hatch lines by setting the MaxHatch system registry variable using
(setenv “MaxHatch” “n”) where n is a number between 100 and 10000000
(ten million).
NoteWhen
changing the value of MaxHatch, you must enter MaxHatch with the
capitalization as shown.
To create a simple hatch
pattern
- Open the acad.pat or acadiso.pat file in a text editor that
saves in ASCII format (for example, Microsoft®
Windows® Notepad).
- Create a header line that includes an
asterisk and a pattern name. The name of the hatch pattern is limited
to 31 characters.
- (Optional) To include a description in
the header line, follow the pattern name with a comma and description
text.
- Create a descriptor line that includes
- An angle at which the line is drawn
- An X,Y origin point
- A delta-x of 0
- A delta-y of any
value
CommandsADCENTER
Manages and inserts
content such as blocks, xrefs, and hatch patterns.
FILL
Controls the filling
of objects such as hatches, 2D solids, and wide polylines.
HATCH
Fills an enclosed area
or selected objects with a hatch pattern, solid fill, or gradient
fill.
HATCHEDIT
Modifies an existing
hatch or fill.
SOLID
Creates solid-filled
triangles and quadrilaterals.
System VariablesFILLMODE
Specifies whether hatches
and fills, 2D solids, and wide polylines are filled in.
HPANG
Sets the angle for new
hatch patterns.
HPBOUND
Controls the object
type created by HATCH and BOUNDARY.
HPDOUBLE
Specifies hatch pattern
doubling for user-defined patterns.
HPNAME
Sets the default hatch
pattern name.
HPSCALE
Sets the hatch pattern
scale factor.
HPSPACE
Sets the hatch pattern
line spacing for user-defined patterns.